package com.xjczjj.controller;

import cn.dev33.satoken.stp.StpUtil;
import com.xjczjj.model.common.Result;
import com.xjczjj.model.pojo.Permission;
import com.xjczjj.model.pojo.SysUser;
import com.xjczjj.service.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 朱佳吉
 * @since 2024-06-04 05:06:48
 */
@RestController
@RequestMapping("/permission")
public class PermissionController {
    @Autowired
    private SysUserService sysUserService;
    @GetMapping("/getMenuTree")
    public Result getMenuTree() {
        int loginIdAsInt = StpUtil.getLoginIdAsInt();
        SysUser sysUser = sysUserService.getById(loginIdAsInt);
        // 相应的权限
        List<Permission> permissionList = sysUser.getPermissionList();
        return Result.ok();
    }
}
